package routers

import (
	// "beegoProject/controllers"
	// "github.com/astaxie/beego"
	// "encoding/json"
	// "fmt"
	// "github.com/astaxie/beego/context"
	"github.com/astaxie/beego"
	"beegoProject/controllers"
)

type Message struct{
	Code int
	Msg string
}
type Server struct {
	ServerName string
	ServerIP   string
}

type Serverslice struct {
	Servers []Server
}

func init() {
	/*自动路由*/
	beego.AutoRouter(&controllers.MainController{})
	beego.AutoRouter(&controllers.MyController{})

	/*注解路由*/
	beego.Include(&controllers.NoteController{})

    // beego.Router("/", &controllers.MainController{})

    // beego.Router("/queryone", &controllers.MainController{}, "post:QueryOne")
	// beego.Router("/querylist", &controllers.MainController{}, "get:QueryList")
	// beego.Router("/insert", &controllers.MainController{}, "post:Insert")
	// beego.Router("/deleteone/:id:int", &controllers.MainController{}, "delete:DeleteOne")
	// beego.Router("/update", &controllers.MainController{}, "post:Update")

	// beego.Post("/test", func(ctx *context.Context){
	// 	var res Message
	// 	testData := `{"code": 100, "msg": "hhhhhhh"}`
	// 	json.Unmarshal([]byte(testData), &res)
	// 	fmt.Println(res)
	// 	var s Server
	// 	str := `{"serverName":"Shanghai_VPN","serverIP":"127.0.0.1"}`
	// 	fmt.Println([]byte(str))
	// 	json.Unmarshal([]byte(str), &s)
	// 	fmt.Println(s)
	// 	ctx.Output.Body([]byte("bob1111111111"))
	// })
}
